#include <stdio.h>
#include <string.h>

int main(int argc,char* argv[])
{
    if(argc!=2)
    {
        printf("argv error\n");
        return 1;
    }

    FILE* fp=fopen(argv[1],"r");
    if(fp==NULL)
    {
        return 2;
    }

    char buffer[1024];
    while(1)
    {
        int s=fread(buffer,1,sizeof(buffer),fp);

        if(s>0)
        {
            buffer[s]=0;
            printf("%s",buffer);
        }

        if(feof(fp))
        {
            break;
        }
    }

    fclose(fp);

    return 0;
}
